@model T2.WebSecurity.ASPMVC.ViewModel.MembershipViewModel
@using T2.WebSecurity.ASPMVC.Entity.Interface        
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Customer Search</title>
</head>
<body>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#membershipslist").jqGrid({
            url: '' ,
            datatype: 'local',
            mtype: 'POST',
			colNames: ['', '', 'Confirmation Token', 'Last Password Failure Date', 'Password Failures Since Last Success', 'Password', 'Password Changed Date', 'Password Salt', 'Password Verification Token', 'Password Verification Token Expiration Date', 'Email Account', 'Password Answer'],
            colModel: [
           { name: 'imgUdt', sortable:false, index: 'imgUdt', width: 20, editable: false, align: 'center' },
           { name: 'imgNew', sortable:false, index: 'imgNew', width: 20, editable: false, align: 'center' },
		   { name: 'ConfirmationToken', index: 'ConfirmationToken', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'LastPasswordFailureDate', index: 'LastPasswordFailureDate', width: 50, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordFailuresSinceLastSuccess', index: 'PasswordFailuresSinceLastSuccess', width: 50, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'Password', index: 'Password', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordChangedDate', index: 'PasswordChangedDate', width: 50, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordSalt', index: 'PasswordSalt', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordVerificationToken', index: 'PasswordVerificationToken', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordVerificationTokenExpirationDate', index: 'PasswordVerificationTokenExpirationDate', width: 50, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'EmailAccount', index: 'EmailAccount', width: 200, editable: false, align: 'left', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}},
			{ name: 'PasswordAnswer', index: 'PasswordAnswer', width: 200, editable: false, align: 'center', color: 'red', searchoptions: { sopt: ['eq', 'ne', 'cn']}}],
            pager: jQuery('#pager'),
            rowNum: 20,
            rowList: [5, 10, 20, 50],
            sortname: 'MembershipID',
            sortorder: "desc",
            multiselect: false,
            shrinktofit: true,
            height: 250,
            width: 750,
            viewrecords: true,
            caption: 'Membership Search',
			loadError: function (xhr, textStatus, errorThrown) {
                       var error_msg = xhr.responseText
                       var msg = "Some errors occurred during processing:"
                       msg += '\n\n' + error_msg
                       $('#dialog').html(msg);
                       $('#dialog').dialog({ title: "Error" });
                   },
			onCellSelect: function(rowid, iCol, cellcontent) {
	                // Click in cell.
	                if (iCol == 0) {
					
						
	                }
					if (iCol == 1) {
					
	                }
	                return true;

	            },

            onSelectRow: function(ids) {
				MembershipID = ids ;
               return true;
            }

        });



            jQuery("#membershipslist").jqGrid('navGrid', '#pager',
            {
                edit: false, add: false, del: false, search: true, refresh: true
            }

            );


            $('#trgSearch').click(function (event) {

var myUrl ="./Membership/Search?ConfirmationToken=" + $("#ConfirmationToken").val() +  "&LastPasswordFailureDate=" + $("#LastPasswordFailureDate").val() +  "&PasswordFailuresSinceLastSuccess=" + $("#PasswordFailuresSinceLastSuccess").val() +  "&Password=" + $("#Password").val() +  "&PasswordChangedDate=" + $("#PasswordChangedDate").val() +  "&PasswordSalt=" + $("#PasswordSalt").val() +  "&PasswordVerificationToken=" + $("#PasswordVerificationToken").val() +  "&PasswordVerificationTokenExpirationDate=" + $("#PasswordVerificationTokenExpirationDate").val() +  "&EmailAccount=" + $("#EmailAccount").val() +  "&PasswordAnswer=" + $("#PasswordAnswer").val();
                
                $("#membershipslist").setGridParam({ datatype: 'json', url: myUrl }).trigger("reloadGrid");
            });

        }); 
    </script>

    
    Confirmation Token: <input type="text" name="ConfirmationToken" id="ConfirmationToken" />
Last Password Failure Date: <input type="text" name="LastPasswordFailureDate" id="LastPasswordFailureDate" />
Password Failures Since Last Success: <input type="text" name="PasswordFailuresSinceLastSuccess" id="PasswordFailuresSinceLastSuccess" />
Password: <input type="text" name="Password" id="Password" />
Password Changed Date: <input type="text" name="PasswordChangedDate" id="PasswordChangedDate" />
Password Salt: <input type="text" name="PasswordSalt" id="PasswordSalt" />
Password Verification Token: <input type="text" name="PasswordVerificationToken" id="PasswordVerificationToken" />
Password Verification Token Expiration Date: <input type="text" name="PasswordVerificationTokenExpirationDate" id="PasswordVerificationTokenExpirationDate" />
Email Account: <input type="text" name="EmailAccount" id="EmailAccount" />
Password Answer: <input type="text" name="PasswordAnswer" id="PasswordAnswer" />


        
        <input type="button" value="Search" id="trgSearch" />
		<table id="membershipslist" class="scroll" cellpadding="0" cellspacing="0" ></table>
        <div id="pager" class="scroll" style="text-align:center;"></div>
</body>
</html>

